﻿Public MustInherit Class Casilla : Implements IEquatable(Of Casilla)
    Protected _Coordenadas As Point
    Protected _Imagen As Image
    Protected _Accesible As Boolean
    Protected _Tamaño As New Size(35, 35)
    Protected _Pb As New PictureBox

    Public Sub New()
        _pb.BackColor = Color.Black
        _pb.BorderStyle = BorderStyle.FixedSingle
        _Pb.BackgroundImage = _Imagen
        _Pb.Location = New Point(_Coordenadas.X * _Tamaño.Width, _Coordenadas.Y * _Tamaño.Height)
        _pb.Size = _Tamaño
    End Sub

    Public Property Accesible() As Boolean
        Get
            Return _Accesible
        End Get
        Set(value As Boolean)
            _Accesible = value
        End Set
    End Property

    Public Property Coordenadas As Point
        Get
            Return _Coordenadas
        End Get
        Set(value As Point)
            _Coordenadas = value
        End Set
    End Property

    Public Property Pb() As PictureBox
        Get
            Return _Pb
        End Get
        Set(value As PictureBox)
            _Pb = value
        End Set
    End Property

    Public Overloads Function Equals(ByVal other As Casilla) As Boolean Implements System.IEquatable(Of Casilla).Equals
        Return Me._Coordenadas = other._Coordenadas
    End Function
End Class
